import random
import os




	# i-10+1		i-10	i-10+1
	# i-1			i		i+1
	# i+10-1		i+10	i+10+1



arg = ([1]+[0]*9)*10

random.shuffle(arg)

for i,x in enumerate(arg):
	print(x,end='')
	if (i+1)%10==0 and i != 0:print('')




for x in range(10):
	for y in range(10):
		print('■',end='')
	print('')

# x,y = 0,1
i = 1
while(1):
	
	key = input()
	os.system('cls')
	control = 0
	if key == 'w':
		i -= 10
	elif key == 's':
		i += 10
	elif key == 'a':
		i -= 1
	elif key == 'd':
		i += 1
	elif key == 'q':
		exit()
	elif key == 'e':
		control = 1
		if arg[i-1] == 1 :
			control = 2
		else:
			control = 1
			x1,y1 = divmod(i,10)		# x1 ~ (0,10)	y1 ~ (0,9)
			kk = []
			num = 0
			for k in (-1,0,1):
				for v in (-1,0,1):
					if x1+k >=0 and x1+k <= 10 and y1+v >= 0 and y1+v <= 9:
						kk.append((x1+k,y1+v))
			for (k,v) in kk:
				n = k*10+v-1
				num += arg[n]
			
	
	# 显示
	for n,c in enumerate(arg):
		# 移动逻辑
		if control == 0 :
			if (n+1) == i :
				print('◎',end='')
			else:
				print('■',end='')
			if (n+1)%10==0 and n != 0:print('')
		# 不是雷
		elif control == 1:
			if (n+1) == i :
				print('◎',end='')
			else:
				x2,y2 = divmod(n+1,10)
				if (x2,y2) in kk:
					
				else:
					print('■',end='')
			if (n+1)%10==0 and n != 0:print('')
		# 是雷
		elif control == 2:
			if c == 1:
				print('☀',end = '')
			else:
				print('■',end='')
			if (n+1)%10==0 and n != 0:print('')
	
	if control == 2:
		print('\nGame Over！')

		
			


